package com.cman777.springc.ratelimiter.alg;


import com.cman777.springc.ratelimiter.alg.storage.RedisStorage;
import com.cman777.springc.ratelimiter.rule.RateRule;
import lombok.AllArgsConstructor;

/**
 * @author chenzhicong
 * @time 2020/9/17 17:57
 */
@AllArgsConstructor
public class AlgFactory {
    private RedisStorage redisStorage;
    public  Alg createAlg(RateRule rateRule,String val){
        if(rateRule.getAlg() == AlgEnum.FIXED_TIME_ALG){
            return new FixedTimeAlg(rateRule,redisStorage,val);
        }
        return null;
    }


}
